<template>
  <el-container>
    <!-- <el-header class="elheader"> </el-header> -->
    <!-- <backline /> -->
    <el-main>
      <div>home</div>
      <!-- <el-input v-model="Account" placeholder="请输入内容"></el-input>
      <el-input v-model="Password" placeholder="请输入内容"></el-input>
      <el-button type="primary" @click="login">登录</el-button>
      <el-button type="primary" @click="test">test</el-button> -->
    </el-main>
  </el-container>
</template>

<script>
import { Login, Test } from "@/api/user";

export default {
  data() {
    return {
      Account: "admin",
      Password: "123456",
      keyword: "",
    };
  },
  methods: {
    async test() {
      var res = await Test();
      console.log("test", res);
    },
    login() {
      var data = { account: this.Account, password: this.Password };
      this.$store.dispatch("LoginFun", data).then((response) => {
        if (response.isSuccess) {
          // 前往首页
          this.$router.push("/user");
        } else {
          this.$message.error(response.errorMsg);
        }
      });
    },
  },
};
</script>

<style>
</style>